package top.jiangqiang.seataservice1;

import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;

public interface AccountRepository extends CrudRepository<Account, Long> {
    @Modifying
    @Query("UPDATE account SET amount = amount - 10 WHERE id = :id")
    int decreaseAmount(long id);
}